package plus.chendd.test.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import plus.chendd.test.config.RootUserConfig;
import plus.chendd.test.config.WhiteListConfig;

@RestController
@RequestMapping("/config")
public class ConfigController {
  
  @Autowired
  private RootUserConfig rootUserConfig;
  @Autowired
  private WhiteListConfig whiteListConfig;
  
  
  @GetMapping("/user")
  public String getUserConfig() {
    System.out.println(rootUserConfig);
    return "1";
  }
  
  @GetMapping("/whiteList")
  public String getWhiteList() {
    whiteListConfig.getPaths().forEach(System.out::println);
    return "222";
  }
}
